<%@ page language="java" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
 <%@include file="../include/jspheader.jsp" %>
 
 <html>
  <style type="text/css">
.unZhankai{
display:none;
}
 

</style>
 <body>
<div id="Mainbody">
 
     <%@include file="../include/top.jsp" %>
     <%@include file="../include/left.jsp" %>
   <form action="<%=request.getContextPath()%>/center/wordList.action" method="post" id="searchform">
  <div class="right2">
    	<div id="TopNav">
            <a href="<%=request.getContextPath()%>/center/studyList.action">学习列表</a> 
            <a href="#" class="this">生词本</a>
            <a href="<%=request.getContextPath()%>/center/collections.action">收藏单词</a>
    	</div>
    <div class="clear"></div>
      <table border="0" cellspacing="0" cellpadding="0" class="datasheet">
      	<tr>
        <th align="left">词汇</th>
        <th width="24%" align="center"><a href="#"><img src="<%=request.getContextPath()%>/images/jiantou.png" width="15" height="15" /> 状态</a></th>
        <th width="19%" align="center">操作</th>
        </tr>
          <s:iterator value="#request.wordList" status="status">
        
        <tr id="<s:property value="id"/>">
        <td>
        <a href="#"  onclick="zhanKaiOrShouLong(<s:property value="id"/>)" ><img src="<%=request.getContextPath()%>/images/shoulongsmall.png" id="img_zs_<s:property value="id"/>"  />
        </a> <s:property value="spelling"/> 
      <s:property value="phonetics" escape="false" />    &nbsp;
        
        <a onclick=pronunciation("<s:property value="spelling"/>")><img src="<%=request.getContextPath()%>/images/voice.png" width="14" height="14" /></a>
         </td>
        <td align="center"><span class="rate">
    <s:if test="level==1">
　                       <span class="finish" id="mosheng_<s:property value="id"/>">陌生</span>
           </s:if>
    <s:if test="level==2">
　                       <span class="finish">模糊</span>
           </s:if>
</span></td>
        <td align="center" id="">
         <s:if test="level==1">
　                   <a href="#" id="mohu_<s:property value="id"/>" onclick=changeLevel("1","2","<s:property value="id"/>") class="StartMemory">模糊</a>&nbsp;&nbsp;<a href="#"  onclick=changeLevel("1","3","<s:property value="id"/>") class="ContinueMemory">熟悉</a>
           </s:if>
         <s:if test="level==2">
　                 <a href="#" onclick=changeLevel("2","3","<s:property value="id"/>")  class="ContinueMemory">熟悉</a>
           </s:if>
       </td>
        </tr>
        
          <tr id="zs_<s:property value="id"/>" class="unZhankai" name="unZhankai">
        <td colspan="2" class="unfoldTd">
        <table border="0" cellspacing="0" cellpadding="0" class="unfold">
         <tr  name="zs">
          <td colspan="3"> 
          <s:property value="meaning"/><br>
          <s:iterator value="sentenceList" id="inner">
          <div><s:property value="#inner.sentence"  escape="false"/></div>
          </s:iterator>
          </td>
        </tr>
        </table>
        </td>
        </tr>
         </s:iterator>
	  </table>
	   <%@include file="../commons/pageNav.jsp" %>
    </div>
    
    	<div class="clear"></div>
     <%@include file="../include/footer.jsp" %>
     
     </form>
</div>
</body>
<script>

function changeLevel(level,changelevel,id){
var params = {
				'query.level' :changelevel,
				'query.wordid' :id
			};
	$.ajax( {
			type :"POST",
			dataType :"json",
			url :"changeLevel.action",
			cache :false,
			data :params,
			success :function(ajaxResult){
			if(ajaxResult.isSuccess==true){
				 if(level=="1"&&changelevel=="2"){
				  document.getElementById("mohu_"+id).style.display="none";
				  document.getElementById("mosheng_"+id).innerHTML="模糊";
				 }else{
				  document.getElementById(id).style.display="none";
				 }
				 }else{
				  alert("操作失败!");
				 }
			},
			clearForm :true
		});
}



</script>
</html>